package com.example.system.controller;

import com.example.common.core.controller.BaseController;
import com.example.common.core.domain.R;
import com.example.system.domain.curriculumSchedule.dto.CurriculumScheduleQueryDTO;
import com.example.system.domain.curriculumSchedule.dto.CurriculumScheduleSaveDTO;
import com.example.system.service.ICurriculumScheduleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/curriculumSchedule")
public class CurriculumScheduleController extends BaseController {
    @Autowired
    private ICurriculumScheduleService curriculumScheduleService;

    @GetMapping("/get")
    public R<Map<Integer, List<Object>>> get(CurriculumScheduleQueryDTO curriculumScheduleQueryDTO) {
        return R.ok(curriculumScheduleService.get(curriculumScheduleQueryDTO));
    }

    @PostMapping("/update")
    public R<Void> update(@RequestBody CurriculumScheduleSaveDTO curriculumScheduleSaveDTO) {

        return toR(curriculumScheduleService.update(curriculumScheduleSaveDTO));
    }

}
